<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Configuring Udev (Applicable to Snapshot-based Backup at the Storage Layer)">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000001864661961">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Configuring Udev (Applicable to Snapshot-based Backup at the Storage Layer)</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000001864661961"></a><a name="EN-US_TOPIC_0000001864661961"></a>

<h1 class="topictitle1">Configuring Udev (Applicable to Snapshot-based Backup at the Storage Layer)</h1>
<div><p>This section describes how to use Udev rules to configure device mapping permissions and persistence for each disk in the scenario where UltraPath is used. The content is for reference only.</p>
<div class="section"><h4 class="sectiontitle">Procedure</h4><ol><li><span>Identify the worldwide ID (WWID) of the device. In this example, <strong>sdb</strong> is used.</span><p><ul><li>Method 1: using UltraPath<pre class="screen">UltraPath CLI #0 &gt;show vlun
----------------------------------------------------------------------------------------------------------
 Vlun ID  Disk          Name                      Lun WWN               Status  Capacity  Ctrl(Own/Work)       
    0     sdb     LUN_200_grid0000    6c4ff1f100ee3d7501948ec2000002c5  Normal  10.00GB       0B/0B                     </pre>
<div class="note"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p>The UltraPath CLI commands may vary with versions. For details, see the <a href="https://support.huawei.com/enterprise/en/cloud-storage/ultrapath-pid-8576127?category=operation-maintenance" target="_blank" rel="noopener noreferrer">UltraPath User Guide</a>.</p>
</div></div>
</li><li>Method 2: running commands<pre class="screen"># cd /dev/disk/by-id
[root@oracle1 by-id]# ll -lh 
lrwxrwxrwx 1 root root  9 Mar 12 17:08 wwn-0x6c4ff1f100ee3d7501948ec2000002c5 -&gt; ../../sdb</pre>
</li></ul>
</p></li><li><span>Create the <strong>99-oracle-asmdevices.rules</strong> file in the <span class="filepath"><b>/etc/udev/rules.d/</b></span> directory.</span></li><li><span>In the <strong>99-oracle-asmdevices.rules</strong> file, create a similar rule for each disk device.</span><p><ul><li>For RHEL 7.<em>x</em>, refer to the following configuration:<pre class="screen">KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u /dev/$name", RESULT=="36c4ff1f100ee3d7501948ec2000002c5", SYMLINK+="raw/LUN_200_DATA0000", OWNER="grid", GROUP="asmadmin", MODE="0660"</pre>
</li><li>For RHEL 6.<em>x</em>, refer to the following configuration:<pre class="screen">KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace 
--device=/dev/$name",RESULT=="36c4ff1f100ee3d7501948ec2000002c5",SYMLINK+="raw/LUN_200_DATA0000",OWNER="grid",GROUP="oinstall",MODE="0660"</pre>
</li></ul>
<div class="note"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul><li>The preceding content is added in a line. If line feeds exist in the configuration file after you copy the preceding content to configuration file <strong>99-oracle-asmdevices.rules</strong>, manually delete the line feeds.</li><li>The parameters of the configured rule are described as follows:<ul><li><strong>KERNEL</strong>: indicates the kernel device name, for example, <strong>dm-2</strong>.</li><li><strong>BUS</strong>: indicates the bus name of a device in <strong>devpath</strong>, for example, <strong>scsi</strong>.</li><li><strong>PROGRAM</strong>: indicates to invoke an external command, for example, <strong>/usr/lib/udev/scsi_id -g -u /dev/dm-2</strong> or <strong>/sbin/scsi_id --whitelisted --device=/dev/$name</strong>.</li><li><strong>RESULT</strong>: indicates the returned result of the external command invoked by PROGRAM, for example, <strong>36207969100f4a3810efc24f70000001a(WWID)</strong>.</li><li><strong>SYMLINK</strong>: indicates to generate symbolic links for device files in <strong>/dev/</strong>. Udev generates only one device file for a device. Therefore, you are advised to use symbolic links to prevent the files generated by default Udev rules from being overwritten. The value of <strong>SYMLINK</strong> can be planned according to the naming rule.</li><li><strong>OWNER, GROUP, MODE</strong>: indicates to set permission for the device.</li></ul>
</li></ul>
</div></div>
</p></li><li><span>Test the created Udev rules. The test procedure is as follows:</span><p><pre class="screen"># udevadm test /sys/block/sdb
udevadm_test: UDEV_LOG=6
udevadm_test: DEVPATH=/devices/up_primary/up_adapter/host15/target15:0:0/15:0:0:1/block/sdb
udevadm_test: MAJOR=8
udevadm_test: MINOR=16
udevadm_test: DEVNAME=/dev/oracle/LUN_200_grid0000
udevadm_test: DEVTYPE=disk
udevadm_test: ACTION=add
udevadm_test: SUBSYSTEM=block
udevadm_test: DEVLINKS=/dev/block/8:16 /dev/disk/by-id/scsi-36c4ff1f100ee3d7501948ec2000002c5 /dev/disk/by-path/scsi-0:0:0:1 /dev/disk/by-id/wwn-0x6c4ff1f100ee3d7501948ec2000002c</pre>
</p></li><li><span>Confirm the permissions required by the devices. The following shows example commands:</span><p><pre class="screen"># ls -lh /dev
brw-rw---- 1 grid oinstall  8,  16 Mar 12 19:35 sdb</pre>
<div class="note"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p>If the required permissions are incorrect, restart the node or the Udev service. The following shows example commands:</p>
<p>RHEL 7.<em>x</em></p>
<pre class="screen">udevadm control --reload-rules
udevadm trigger
or
udevadm trigger --type=devices --action=change</pre>
<p>RHEL 6.<em>x</em></p>
<pre class="screen">udevadm control --reload-rules
start_udev</pre>
</div></div>
</p></li></ol>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>